home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / maprot1a / form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-09-04  |  4.1 KB  |  180 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   5460
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   9960
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   5460
  10.    ScaleWidth      =   9960
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.PictureBox tilemain 
  13.       AutoRedraw      =   -1  'True
  14.       AutoSize        =   -1  'True
  15.       Height          =   315
  16.       Left            =   120
  17.       Picture         =   "Form1.frx":0000
  18.       ScaleHeight     =   255
  19.       ScaleWidth      =   5100
  20.       TabIndex        =   3
  21.       Top             =   4440
  22.       Visible         =   0   'False
  23.       Width           =   5160
  24.    End
  25.    Begin VB.CommandButton Command2 
  26.       Caption         =   "<--"
  27.       Height          =   255
  28.       Left            =   3120
  29.       TabIndex        =   2
  30.       Top             =   5040
  31.       Width           =   735
  32.    End
  33.    Begin VB.CommandButton Command1 
  34.       Caption         =   "-->"
  35.       Height          =   255
  36.       Left            =   5520
  37.       TabIndex        =   1
  38.       Top             =   5040
  39.       Width           =   735
  40.    End
  41.    Begin VB.Timer Timer1 
  42.       Interval        =   1
  43.       Left            =   1320
  44.       Top             =   5160
  45.    End
  46.    Begin VB.PictureBox buff 
  47.       AutoRedraw      =   -1  'True
  48.       AutoSize        =   -1  'True
  49.       BackColor       =   &H00000000&
  50.       Height          =   7095
  51.       Left            =   7440
  52.       ScaleHeight     =   7035
  53.       ScaleWidth      =   12075
  54.       TabIndex        =   0
  55.       Top             =   8280
  56.       Visible         =   0   'False
  57.       Width           =   12135
  58.    End
  59. Attribute VB_Name = "Form1"
  60. Attribute VB_GlobalNameSpace = False
  61. Attribute VB_Creatable = False
  62. Attribute VB_PredeclaredId = True
  63. Attribute VB_Exposed = False
  64. 'Written by Jonathon Lopez
  65. 'jjmlopez@flash.net
  66. Dim i As Integer, j As Integer, k As Integer, l As Integer, m As Integer, map As Variant, maprot As Variant, n As Integer, o As Integer, found As Boolean, a As Integer, b As Integer, c As Variant, d As Variant, e As Variant, f As Variant, px As Variant, pos As Variant, find1 As Boolean, fY As Integer, fX As Integer, f1 As Integer, f2 As Integer, f3 As Integer, f4 As Integer
  67. Private Sub Command1_Click()
  68. n = 20
  69. 'rotate map
  70. For j = 0 To 19
  71. n = n - 1
  72. o = 20
  73. For i = 0 To 19
  74. o = o - 1
  75. map(i, n) = maprot(j, i)
  76. Next i
  77. Next j
  78. For j = 0 To 19
  79. For i = 0 To 19
  80. maprot(j, i) = map(j, i)
  81. Next i
  82. Next j
  83. n = 20
  84. For j = 0 To 19
  85. n = n - 1
  86. o = 20
  87. For i = 0 To 19
  88. o = o - 1
  89. map(n, o) = maprot(j, i)
  90. Next i
  91. Next j
  92. For j = 0 To 19
  93. For i = 0 To 19
  94. maprot(j, i) = map(j, i)
  95. Next i
  96. Next j
  97. End Sub
  98. Private Sub Command2_Click()
  99. n = 20
  100. 'rotate map
  101. For j = 0 To 19
  102. n = n - 1
  103. o = 20
  104. For i = 0 To 19
  105. o = o - 1
  106. map(o, n) = maprot(j, i)
  107. Next i
  108. Next j
  109. For j = 0 To 19
  110. For i = 0 To 19
  111. maprot(j, i) = map(j, i)
  112. Next i
  113. Next j
  114. n = 20
  115. For j = 0 To 19
  116. n = n - 1
  117. For i = 0 To 19
  118. map(n, i) = maprot(j, i)
  119. Next i
  120. Next j
  121. For j = 0 To 19
  122. For i = 0 To 19
  123. maprot(j, i) = map(j, i)
  124. Next i
  125. Next j
  126. End Sub
  127. Private Sub Form_Load()
  128. k = 50
  129. 'create map data
  130. ReDim maprot(0 To 19, 0 To 19)
  131. ReDim map(0 To 19, 0 To 19)
  132. ReDim c(0 To 19, 0 To 19)
  133. ReDim pos(0 To 1, 0 To 1)
  134. pos(0, 0) = 0
  135. pos(0, 1) = 0
  136. For j = 0 To 19
  137. For i = 0 To 19
  138. Randomize
  139. m = Int(Rnd * 3)
  140. map(j, i) = m
  141. maprot(j, i) = m
  142. Next i
  143. Next j
  144. For j = 4 To 7
  145. For i = 0 To 19
  146. map(j, i) = 3
  147. maprot(j, i) = 3
  148. Next i
  149. Next j
  150. map(3, 8) = 8
  151. maprot(3, 8) = 8
  152. map(3, 9) = 7
  153. maprot(3, 9) = 7
  154. map(2, 8) = 3
  155. maprot(2, 8) = 3
  156. map(0, 8) = 3
  157. maprot(0, 8) = 3
  158. map(1, 8) = 3
  159. maprot(1, 8) = 3
  160. map(1, 9) = 3
  161. maprot(1, 9) = 3
  162. map(0, 9) = 3
  163. maprot(0, 9) = 3
  164. map(0, 10) = 6
  165. maprot(0, 10) = 6
  166. map(2, 9) = 3
  167. maprot(2, 9) = 3
  168. End Sub
  169. Private Sub Timer1_Timer()
  170. buff.Picture = buff.Picture
  171. For j = 0 To 19
  172. For i = 0 To 19
  173. l = map(j, i)
  174. Call bitblt(buff.hDC, (i * 16) - j * 16 + 300, (i * 8) + j * 8, 35, 17, tilemain.hDC, l * 34, 0, SRCPAINT)
  175. Next i
  176. Next j
  177. Call bitblt(Me.hDC, 0, 0, 1200, 325, buff.hDC, 0, 0, SRCCOPY)
  178. 'k = k - 5
  179. End Sub
  180.